package com.mkyong.android;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.app.Dialog;
import android.widget.ImageView;
import android.widget.TextView;

public class App2Activity extends Activity {
	
	

	Button button;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.categorie);
		addListenerOnButton2();
		addListenerOnButton4();
		addListenerOnButton6();
		addListenerOnButton8();
	}

	public void addListenerOnButton2() {

		final Context context = this;

		button = (Button) findViewById(R.id.vleesknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.vlees); 
				addListenerOnButton3();
			}

		});

	}
	
	public void addListenerOnButton3() {

		final Context context = this;

		button = (Button) findViewById(R.id.schnitzelknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.schnitzel); 

			}

		});

	}	
	
	public void addListenerOnButton4() {

		final Context context = this;

		button = (Button) findViewById(R.id.visknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.vis);
				addListenerOnButton5();

			}

		});

	}	
	
	public void addListenerOnButton5() {

		final Context context = this;

		button = (Button) findViewById(R.id.zalmknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.zalm);
				

			}

		});

	}	
	
	public void addListenerOnButton6() {

		final Context context = this;

		button = (Button) findViewById(R.id.groentenknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.groenten);
				addListenerOnButton7();

			}

		});

	}
	
	
	public void addListenerOnButton7() {

		final Context context = this;

		button = (Button) findViewById(R.id.wortelenknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.wortelen);
				

			}

		});

	}
	
	public void addListenerOnButton8() {

		final Context context = this;

		button = (Button) findViewById(R.id.fruitknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.fruit);
				addListenerOnButton9();

			}

		});

	}
	
	
	
	public void addListenerOnButton9() {

		final Context context = this;

		button = (Button) findViewById(R.id.banaanknop);

		button.setOnClickListener(new OnClickListener() {

			public void onClick(View arg0) {
				setContentView(R.layout.banaan);
				

			}

		});

	}
	
	
	

	
}






